import request from "./request";

//商品管理
export class GoodsManageApi {
    getGoodsTypes() {
        return request({url: '/api/v1/org/PointsmallHome', method: 'get'})
    }

    getGoodsList({key, cate_id, type_id, page}) {
        let data = {key, cate_id, type_id, page}
        return request({url: '/api/v1/org/getPointsgoods', method: 'post', data})
    }

    getGoodsDetail(goods_id) {
        let data = {goods_id}
        return request({url: '/api/v1/org/getGoodsDetail', method: 'get', data})
    }

    saveResource(path, type = 'image') {
        let data = {path, type}
        return request({url: '/api/v1/saveRes', method: 'post', data})
    }

    addGoods({image, cate_id, name, price, points, storage, limitnum, status, description}) {
        let data = {image, cate_id, name, price, points, storage, limitnum, status, description}
        return request({url: '/api/v1/org/subGoods', method: 'post', loading: false, data})
    }
}
